package dao;
import org.hibernate.SessionFactory;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Silvita
 */
public class MyFactory {
    
    private SessionFactory sf;
    private MyConfig mc;

    public MyFactory() throws Exception {
        try{
            mc = new MyConfig();
            sf = mc.getConfig().buildSessionFactory();
        }catch(Exception e){
            throw new Exception("No se pudo crear la fabrica de sesiones: " + e.getMessage());
        }
    }

    public MyConfig getMc() {
        return mc;
    }

    public void setMc(MyConfig mc) {
        this.mc = mc;
    }

    public SessionFactory getSf() {
        return sf;
    }

    public void setSf(SessionFactory sf) {
        this.sf = sf;
    }
}
